package persistence.dto;

import common.util.DateUtils;
import java.util.Calendar;

import core.Product;

public class ProductDTO
{
	
	private float amountNum;
	private String amountType;
	private String barcode;
	private Calendar creationDate;
	private String description;
	private int id;
	private int shelfLife;
	private int threeMonthSupply;
	private boolean removed;
	/**
	 * converts a product into a DTO
	 * @param p the product to be converted
	 */
	public ProductDTO(int id, float amountNum, String amountType, 
			String barcode, Calendar creationDate,
			String description, int shelfLife, int threeMonthSupply )
	{
		this.amountNum = amountNum;
		this.amountType = amountType;
		this.barcode = barcode;
		this.creationDate = creationDate;
		this.description = description;
		this.id = id;
		this.shelfLife = shelfLife;
		this.threeMonthSupply = threeMonthSupply;
		this.removed = false;;
	}
        /**
	 * converts a product into a DTO, id not set
	 * @param p the product to be converted
	 */
	public ProductDTO(float amountNum, String amountType, String barcode, Calendar creationDate,
			String description, int shelfLife, int threeMonthSupply )
	{
		this.amountNum = amountNum;
		this.amountType = amountType;
		this.barcode = barcode;
		this.creationDate = creationDate;
		this.description = description;
		this.shelfLife = shelfLife;
		this.threeMonthSupply = threeMonthSupply;
		this.removed = false;
	}
        
    public void setRemoved(boolean val)
    {
    	removed = val;
    }
    public boolean getRemoved()
    {
    	return removed;
    }
	
	public void setId(int id)
        {
            this.id = id;
        }
        
	public float getAmountNum()
	{
		return amountNum;
	}
	public String getAmountType()
	{
		return amountType;
	}
	public String getBarcode()
	{
		return barcode;
	}
	public String getCreationDate()
	{
            return DateUtils.formatDateTime(creationDate.getTime());
	}
	
	public Calendar getCreationDateCal()
	{
            return creationDate;
	}
	public String getDescription()
	{
		return description;
	}
	public int getId()
	{
		return id;
	}
	public int getShelfLife()
	{
		return shelfLife;
	}
	public int getThreeMonthSupply()
	{
		return threeMonthSupply;
	}

}
